package cn.rengy.web.framework.sys.userrole.web;

import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.rengy.lang.ResultEntity;
import cn.rengy.web.framework.sys.userrole.service.UserRoleService;


/**
 * 用户授权角色
 * 
 */
@Controller
@RequestMapping(value = "/authenticated/userrole")
public class UserRoleController {
	private static Logger logger = LoggerFactory.getLogger(UserRoleController.class);
	@Autowired
	private UserRoleService userRoleService;
	
	/**
	 * 角色菜单权限设置
	 * @param paramMap
	 * @return
	 */
	@RequiresRoles(value={"developer"})
	@RequestMapping(method = RequestMethod.POST)
	@ResponseBody
	public ResultEntity<?> save (@RequestBody Map<String,Object> paramMap){
		userRoleService.save(paramMap);
		return ResultEntity.ok();
	}
	
	
}
